<?php

/*
 * litchicms
 * Copyright (C) 2010-5-25 Author: tiefa(539247@qq.com)
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
!defined('BRK') && exit("!");
check_rights_by_id(29);



if (!empty($RT['v']['groupid'])) {
    if (!$row = brk_select_one('group', '*', "WHERE group_id='" . intval($RT['v']['groupid']) . "'")) {
        msg("该组不存在.");
    } else {
        if ($row['group_id'] == '1') {
            msg("系统权限组不可以删除.");
        } else {
            brk_delete('group', " WHERE group_id='" . intval($RT['v']['groupid']) . "'");
            brk_delete('group_right', " WHERE group_id='" . intval($RT['v']['groupid']) . "'");
            is_file($file = SYSTEM . 'cache/con_rights/' . intval($RT['v']['groupid']) . '.php') && unlink($file);
            header301($_SERVER['HTTP_REFERER']);
            exit;
        }
    }
}


